<div class="children-container">
  <% if (locals.kicker) { %>
    <h3>
    <% if (locals.link) { %><a href="<%= formatUrl(locals.link) %>"><% } %>
    <%= kicker %>
    <% if (locals.link) { %></a><% } %>
    </h3>
  <% } %>
  <div class="children-view hide">
    <ul class="children">
      <% children.forEach((link) => { %>
        <% const type = link.resourceType %>
        <li class="type-<%= type %>">
          <%
          const iconMap = {
            document: 'file-o',
            spreadsheet: 'table',
            'text/html': 'file-o',
            folder: 'folder',
            presentation: 'clone',
            image: 'picture-o',
            video: 'video-camera',
            pdf: 'file-pdf-o'
          }
          const iconName = iconMap[type] || 'external-link'
          const className = `fa-${iconName}`
          const href = formatUrl(link.url)
          %>
          <i class="fa foldericon <%= className %>" aria-hidden="true"></i>
          <a class="content-link" href="<%= href %>" ><%= link.name %></a>
        </li>
      <% }) %>
    </ul>
  </div>
</div>
